﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void cmdLogin_Click(object sender, EventArgs e)
    {
        string username = frmLogin.Text.ToUpper();
        string contrasena = frmContrasena.Text;
        RE_User user = DB.ValidaCliente(username, contrasena);

        if (user != null) {
            Session["userid"] = user;
            if (user.Level == 4 || user.Level == 5)
                Response.Redirect("../patriota/MultipleSearch.aspx");
            else
                Response.Redirect("principal.aspx");
        } else
        {
            lbnotautenticate.Text = "Invalid user";
            lbnotautenticate.Visible = true;
        }
    }
}
